package com.cm.springcloud.service;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableDiscoveryClient
//@EnableFeignClients(basePackageClasses= {org.study.springcloud.service1.api.Service2Feign.class})
@EnableFeignClients
public class StudySpringcloudServiceApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = SpringApplication.run(StudySpringcloudServiceApplication.class, args);
		String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
		for (String beanDefinitionName : beanDefinitionNames) {
			BeanDefinition definition = applicationContext.getBeanFactory().getBeanDefinition(beanDefinitionName);
			System.out.println("definition = " + definition.getBeanClassName());
		}
	}
}
